package com.example.smartcity.ui.Adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.example.smartcity.R;

import okhttp3.Response;


public class SelfCenterListAdapter extends ArrayAdapter {
    private int Resource;
    private String[] array;
    public SelfCenterListAdapter(@NonNull Context context, int resource, @NonNull String[] array) {
        super(context, resource, array);
        this.Resource = resource;
        this.array = array;
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        View view = LayoutInflater.from(getContext()).inflate(Resource,parent,false);
        TextView textView = view.findViewById(R.id.TV_item);
        textView.setText(array[position]);
        return view;
    }
}
